package com.wensi.lib_voice.words

import android.content.Context
import com.wensi.lib_voice.R
import kotlin.random.Random

/**
 * 语义词条
 */
object WordTools {
    // 唤醒
    private lateinit var wakeupArray: Array<String>
    // 无法应答
    private lateinit var noanswerArray: Array<String>
    // 暂不支持该功能
    private lateinit var nosupportArray: Array<String>

    fun initTools (context: Context) {
        context?.apply {
            wakeupArray = resources.getStringArray(R.array.WakeUpListArray)
            noanswerArray = resources.getStringArray(R.array.NoAnswerArray)
            nosupportArray = resources.getStringArray(R.array.NoSupportArray)
        }
    }
    // 随机命中唤醒词条
    fun wakeupWords(): String {
        return wakeupArray[Random.nextInt(wakeupArray.size)]

    }
    fun noanswerWords(): String {
        return noanswerArray[Random.nextInt(noanswerArray.size)]

    }
    fun nosupportWords(): String {
        return nosupportArray[Random.nextInt(nosupportArray.size)]

    }
}